
import {Component, createApp} from "vue";

import ElementPlus from "element-plus";
import "element-plus/theme-chalk/index.css";
import zhCn from "element-plus/es/locale/lang/zh-cn";
import "./assets/main.css";

import "./util/mySessionStorage.js";
import "./util/myLocalStorage.js";

window.addEventListener("unhandledrejection", e => {
  window.api.addLog(e.reason)
})

window.onerror = (ev, source, lineno, colno, error) => {
  window.api.addLog(error.message)
  return false
}
window.onkeydown = ev => {
  if (ev.key == 'F11') {
    ev.preventDefault()
  }
  if (ev.ctrlKey && ev.shiftKey && ev.key == 'I') {
    ev.preventDefault()
  }
}

export function createVueApp(App: Component) {
  createApp(App).use(ElementPlus, {size: "small", locale: zhCn}).mount("#app");
}